package com.ljj.controller;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import com.ljj.entity.Record;
import com.ljj.mapper.RecordMapper;
import com.ljj.utli.Result;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author liujiju
 * @since 2021-11-19
 */
@CrossOrigin
@RestController
@RequestMapping("/record")
public class RecordController {
	
	@Autowired
	RecordMapper rm;
	
	@RequestMapping("/relist")
	public Object relist(Record re) {
		List<Record> list = rm.relist(re);
		
		re.setLimit(null);
		re.setPage(null);
		List<Record> list2 = rm.relist(re);
		return new Result (0,"",list,list2.size()) ;
		
		
	}
	

	@RequestMapping("/redelete")
	public Object redelete(Record re) {
		if(rm.deleteById(re)>0) {
		
			return new Result(0,"删除成功");
		}else {
			return new Result(0,"删除失败");
		}
		
		
	
		
		
	}


}
